// const BASE_URL='https://www.uinav.com'
const BASE_URL='https://api-ugo-dev.itheima.net'

 
function request({url,data,method,isLoading=true}) {
				return new Promise(resolve => {
					if(isLoading){
					wx.showLoading({
						title: '加载中',
					})	
					}
					uni.request({
						url:BASE_URL+url,
						data,
						method,
						success: (res) => {
							uni.hideLoading()
							let {
								message,
								meta
							} = res.data
							if (meta.status === 200) {					
								resolve(message)
							}
						}
					})
				})
			}
			
			export default request